using System;
using System.Data.Linq;
using System.Data.Linq.Mapping;
namespace MicroMsg.Storage
{
	[Table]
	public class FBContact : StorageItem
	{
		[Column(IsPrimaryKey = true)]
		public ulong nID;
		[Column]
		public string strFacebookName;
		[Column]
		public uint nImgKey;
		[Column]
		public string strMD5;
		[Column]
		public string strUsrName;
		[Column]
		public string strNickName;
		[Column]
		public string strNickNamePYInitial;
		[Column]
		public string strNickNameQuanPin;
		[Column]
		public string strRealName;
		[Column]
		public string strRealNamePYInitial;
		[Column]
		public string strRealNameQuanPin;
		[Column]
		public string strMobile;
		[Column]
		public string strEmail;
		[Column]
		public int nType;
		[Column]
		public int nStatus;
		[Column]
		public uint nFlag;
		[Column]
		public string strSignature;
		[Column]
		public int nSex;
		[Column]
		public string strProvince;
		[Column]
		public string strCity;
		[Column]
		public int nHasHeadImg;
		[Column]
		public uint nPersonalCard;
		[Column]
		public long nLastUpdateTime;
		[Column]
		public string strAlias;
		[Column(IsVersion = true)]
		private Binary _version;
		[Column(DbType = "Image")]
		public byte[] bytesXmlBuf;
		private FBContactXmlData _xmlData;
		public uint nSnsFlag
		{
			get
			{
				this.load();
				return this._xmlData.nSnsFlag;
			}
			set
			{
				this.load();
				this._xmlData.nSnsFlag = value;
				this.unload();
			}
		}
		public string strSnsBGImgID
		{
			get
			{
				this.load();
				return this._xmlData.strSnsBGImgID;
			}
			set
			{
				this.load();
				this._xmlData.strSnsBGImgID = value;
				this.unload();
			}
		}
		public ulong nSnsBGObjectID
		{
			get
			{
				this.load();
				return this._xmlData.nSnsBGObjectID;
			}
			set
			{
				this.load();
				this._xmlData.nSnsBGObjectID = value;
				this.unload();
			}
		}
		private void load()
		{
			if (this._xmlData != null)
			{
				return;
			}
			this._xmlData = StorageXml.loadFromBuffer<FBContactXmlData>(this.bytesXmlBuf);
			if (this._xmlData == null)
			{
				this._xmlData = new FBContactXmlData();
			}
		}
		private void unload()
		{
			this.bytesXmlBuf = StorageXml.saveToBuffer<FBContactXmlData>(this._xmlData);
		}
	}
}
